<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>数组语法</title>
  <style>
    .baseStyles {
      width: 200px;
      height: 200px;
      border: 1px red solid;
    }
  </style>
</head>
<body>

<div id="app">
  <div :style="[baseStyles, overrideStyle]">style数组语法</div>
  <button @click="handle">切换</button>
</div>

<script src="../lib/vue.js"></script>
<script>
  let vm = new Vue({
    el: '#app',
    data: {
      baseStyles: {
        width: '200px',
        height: '200px',
        border: '1px red solid'
      },
      overrideStyle: {
        width: '400px',
        border: '2px blue dotted'
      }
    },
    methods: {
      handle() {
        this.overrideStyle = ''
      }
    }
  })
</script>

</body>
</html>